home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / xwindows / demos / xfract_1.z / xfract_1 / xfractint-1.06 / fractalp.c < prev    next >
C/C++ Source or Header  |  1992-09-28  |  41KB  |  853 lines

  1. /*
  2.     This module consists only of the fractalspecific structure
  3.     and a *slew* of defines needed to get it to compile
  4. */
  5.  
  6. /* includes needed for fractalspecific */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include "fractint.h"
  11. #include "mpmath.h"
  12. #include "helpdefs.h"
  13. #include "fractype.h"
  14. #include "prototyp.h"
  15.  
  16. /* functions defined elswhere needed for fractalspecific */
  17. /* moved to prototyp.h */
  18.  
  19. /* parameter descriptions */
  20. /* Note: parameters preceded by + are integer parameters */
  21.  
  22. /* for Mandelbrots */
  23. static char realz0[] = "Real Perturbation of Z(0)";
  24. static char imagz0[] = "Imaginary Perturbation of Z(0)";
  25.  
  26. /* for Julias */
  27. static char realparm[] = "Real Part of Parameter";
  28. static char imagparm[] = "Imaginary Part of Parameter";
  29.  
  30. /* for Newtons */
  31. static char newtdegree[] = "+Polynomial Degree (> 2)";
  32.  
  33. /* for MarksMandel/Julia */
  34. static char exponent[]   = "Real part of Exponent";
  35. static char imexponent[] = "Imag part of Exponent";
  36.  
  37. /* for Complex Newton */
  38. static char realroot[]     = "Real part of Root";
  39. static char imagroot[]     = "Imag part of Root";
  40. static char realdegree[] = "Real part of Degree";
  41. static char imagdegree[] = "Imag part of Degree";
  42.  
  43. /* for Lorenz */
  44. static char timestep[]       = "Time Step";
  45.  
  46. /* for formula */
  47. static char p1real[] = "Real portion of p1";
  48. static char p2real[] = "Real portion of p2";
  49. static char p1imag[] = "Imaginary portion of p1";
  50. static char p2imag[] = "Imaginary portion of p2";
  51.  
  52. /* trig functions */
  53. static char recoeftrg1[] = "Real Coefficient First Function";
  54. static char imcoeftrg1[] = "Imag Coefficient First Function";
  55. static char recoeftrg2[] = "Real Coefficient Second Function";
  56. static char imcoeftrg2[] = "Imag Coefficient Second Function";
  57.  
  58. /* MCP 7-7-91
  59. static char recoefsqr[] = "Real Coefficient Square Term";
  60. static char imcoefsqr[] = "Imag Coefficient Square Term";
  61. */
  62.  
  63. static char recoef2nd[] = "Real Coefficient Second Term";
  64. static char imcoef2nd[] = "Imag Coefficient Second Term";
  65.  
  66. /* KAM Torus */
  67. static char kamangle[] = "Angle (radians)";
  68. static char kamstep[] =  "Step size";
  69. static char kamstop[] =  "Stop value";
  70. static char pointsperorbit[] = "+Points per orbit";
  71.  
  72. /* Newtbasin */
  73. static char stripes[] = "Enter non-zero value for stripes";
  74.  
  75. /* Gingerbreadman */
  76. static char initx[] = "Initial x";
  77. static char inity[] = "Initial y";
  78.  
  79. /* popcorn */
  80. static char step[] = "Step size";
  81.  
  82. /* bifurcations */
  83. static char filt[] = "+Filter Cycles";
  84. static char seed[] = "Seed Population";
  85.  
  86. /* bailout defines */
  87. #define FTRIGBAILOUT 2500.0
  88. #define LTRIGBAILOUT   64.0
  89. #define STDBAILOUT        4.0
  90. #define NOBAILOUT    0.0
  91.  
  92. struct fractalspecificstuff far fractalspecific[] =
  93. {
  94.    /*
  95.      fractal name, parameter text strings, parameter values,
  96.      helptext, helpformula, flags,
  97.      xmin  xmax  ymin  ymax int tojulia   tomandel tofloat  symmetry
  98.    |------|-----|-----|-----|--|--------|---------|--------|---------|
  99.      orbit fnct     per_pixel fnct  per_image fnct  calctype fcnt    bailout
  100.    |---------------|---------------|---------------|----------------|-------|
  101.    */
  102.  
  103.    "mandel", realz0, imagz0,"","",0,0,0,0,
  104.    HT_MANDEL, HF_MANDEL, WINFRAC,
  105.    -2.5,  1.5, -1.5,  1.5, 1, JULIA, NOFRACTAL, MANDELFP, XAXIS_NOPARM,
  106.    JuliaFractal, mandel_per_pixel,MandelSetup, StandardFractal, STDBAILOUT,
  107.  
  108.    "julia", realparm, imagparm,"","",0.3,0.6,0,0,
  109.    HT_JULIA, HF_JULIA, WINFRAC,
  110.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MANDEL, JULIAFP,  ORIGIN,
  111.    JuliaFractal, julia_per_pixel, JuliaSetup, StandardFractal, STDBAILOUT,
  112.  
  113.    "*newtbasin", newtdegree,stripes, "","",3,0,0,0,
  114.    HT_NEWTBAS, HF_NEWTBAS, WINFRAC,
  115.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTBASIN,   NOSYM,
  116.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  117.  
  118.    "lambda",      realparm, imagparm,"","",0.85,0.6,0,0,
  119.    HT_LAMBDA, HF_LAMBDA, WINFRAC,
  120.    -1.5,  2.5, -1.5,  1.5, 1, NOFRACTAL, MANDELLAMBDA, LAMBDAFP,  NOSYM,
  121.    LambdaFractal,   julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  122.  
  123.    "*mandel",    realz0, imagz0,"","",0,0,0,0,
  124.    HT_MANDEL, HF_MANDEL, WINFRAC,
  125.    -2.5,  1.5, -1.5,  1.5, 0, JULIAFP,   NOFRACTAL, MANDEL,  XAXIS_NOPARM,
  126.    JuliafpFractal,mandelfp_per_pixel, MandelfpSetup, StandardFractal, STDBAILOUT,
  127.  
  128.    "*newton", newtdegree, "", "","",3,0,0,0,
  129.    HT_NEWT, HF_NEWT, WINFRAC,
  130.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTON,    XAXIS,
  131.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  132.  
  133.    "*julia",     realparm, imagparm,"","",0.3,0.6,0,0,
  134.    HT_JULIA, HF_JULIA, WINFRAC,
  135.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELFP, JULIA,  ORIGIN,
  136.    JuliafpFractal, juliafp_per_pixel,  JuliafpSetup, StandardFractal,STDBAILOUT,
  137.  
  138.    "plasma",      "Graininess Factor (.1 to 50, default is 2)",
  139.                   "+Algorithm (0 = original, 1 = new)",
  140.                   "+Random Seed Value (0 = Random, 1 = Reuse Last)",
  141.                   "",2,0,0,0,
  142.    HT_PLASMA, HF_PLASMA, NOZOOM+NOGUESS+NOTRACE+NORESUME+WINFRAC,
  143.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  144.    NULL,       NULL,   StandaloneSetup,     plasma,      NOBAILOUT,
  145.  
  146.    "*mandelfn",  realz0, imagz0,"","",0,0,0,0,
  147.    HT_MANDFN, HF_MANDFN, TRIG1+WINFRAC,
  148.    -8.0,  8.0, -6.0,  6.0, 0, LAMBDATRIGFP,NOFRACTAL, MANDELTRIG, XYAXIS_NOPARM,
  149.    LambdaTrigfpFractal,othermandelfp_per_pixel,MandelTrigSetup,StandardFractal,LTRIGBAILOUT,
  150.  
  151.    "*manowar",    realz0, imagz0,"","",0,0,0,0,
  152.    HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
  153.    -2.5,  1.5, -1.5,  1.5, 0, MANOWARJFP, NOFRACTAL, MANOWAR,  XAXIS_NOPARM,
  154.    ManOWarfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  155.  
  156.    "manowar",    realz0, imagz0,"","",0,0,0,0,
  157.    HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
  158.    -2.5,  1.5, -1.5,  1.5, 1, MANOWARJ, NOFRACTAL, MANOWARFP, XAXIS_NOPARM,
  159.    ManOWarFractal,mandel_per_pixel, MandellongSetup,StandardFractal,STDBAILOUT,
  160.  
  161.    "test","(testpt Param #1)","(testpt param #2)","(testpt param #3)","(testpt param #4)",0,0,0,0,
  162.    HT_TEST, HF_TEST, 0,
  163.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  164.    NULL,      NULL,         StandaloneSetup, test,    STDBAILOUT,
  165.  
  166.    "sierpinski",  "","","","",0,0,0,0,
  167.    HT_SIER, HF_SIER, WINFRAC,
  168.    -0.9,  1.7, -0.9,  1.7, 1, NOFRACTAL, NOFRACTAL, SIERPINSKIFP,   NOSYM,
  169.    SierpinskiFractal,long_julia_per_pixel, SierpinskiSetup,StandardFractal,127.0,
  170.  
  171.    "barnsleym1",  realz0, imagz0,"","",0,0,0,0,
  172.    HT_BARNS, HF_BARNSM1, WINFRAC,
  173.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ1,NOFRACTAL, BARNSLEYM1FP,  XYAXIS_NOPARM,
  174.    Barnsley1Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  175.  
  176.    "barnsleyj1",  realparm, imagparm,"","",0.6,1.1,0,0,
  177.    HT_BARNS, HF_BARNSJ1, WINFRAC,
  178.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM1, BARNSLEYJ1FP,  ORIGIN,
  179.    Barnsley1Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  180.  
  181.    "barnsleym2",  realz0, imagz0,"","",0,0,0,0,
  182.    HT_BARNS, HF_BARNSM2, WINFRAC,
  183.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ2,NOFRACTAL, BARNSLEYM2FP,  YAXIS_NOPARM,
  184.    Barnsley2Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  185.  
  186.    "barnsleyj2",  realparm, imagparm,"","",0.6,1.1,0,0,
  187.    HT_BARNS, HF_BARNSJ2, WINFRAC,
  188.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, BARNSLEYM2, BARNSLEYJ2FP,  ORIGIN,
  189.    Barnsley2Fractal,long_julia_per_pixel,JulialongSetup,StandardFractal,STDBAILOUT,
  190.  
  191.    "sqr(fn)", "","","","",0,0,0,0,
  192.    HT_SCOTSKIN, HF_SQRFN, TRIG1+WINFRAC,
  193.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, SQRTRIGFP,XAXIS,
  194.    SqrTrigFractal,   long_julia_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  195.  
  196.    "*sqr(fn)", "","","","",0,0,0,0,
  197.    HT_SCOTSKIN, HF_SQRFN, TRIG1+WINFRAC,
  198.    -4.0,  4.0, -3.0,  3.0, 0, NOFRACTAL, NOFRACTAL, SQRTRIG,XAXIS,
  199.    SqrTrigfpFractal,   otherjuliafp_per_pixel, SqrTrigSetup,  StandardFractal,LTRIGBAILOUT,
  200.  
  201.    "fn+fn", recoeftrg1, imcoeftrg1,recoeftrg2, imcoeftrg2,1,0,1,0,
  202.    HT_SCOTSKIN, HF_FNPLUSFN, TRIG2+WINFRAC,
  203.    -4.0,  4.0, -3.0,  3.0, 16, NOFRACTAL, NOFRACTAL, TRIGPLUSTRIGFP,XAXIS,
  204.    TrigPlusTrigFractal,   long_julia_per_pixel, TrigPlusTriglongSetup,    StandardFractal,LTRIGBAILOUT,
  205.  
  206.    "mandellambda",realz0, imagz0,"","",0,0,0,0,
  207.    HT_MLAMBDA, HF_MLAMBDA, WIN